33. PCA Mini-Project
PCA Mini-Project
PCA Mini-Project
Our discussion of PCA spent a lot of time on theoretical issues, so in this mini-project we’ll ask you to play around with some sklearn code. The eigenfaces code is interesting and rich enough to serve as the testbed for this entire mini-project.
The starter code can be found in pca/eigenfaces.py . This was mostly taken from the example found here , on the sklearn documentation.
INSTRUCTOR NOTE:
Take note when running the code, that there are changes in one of the parameters for the
SVC
function called on line 94 of
pca/eigenfaces.py
. For the 'class_weight' parameter, the argument string "auto" is a valid value for sklearn version 0.16 and prior, but will be depreciated by 0.19. If you are running sklearn version 0.17 or later, the expected argument string should be "balanced". If you get an error or warning when running
pca/eigenfaces.py
, make sure that you have the correct argument on line 98 that matches your installed version of sklearn.